package com.lvy.hczn.front.system.domain.business;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lvy.hczn.front.common.core.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 销售单
 *
 * @author yw
 * @date 2021-12-15 16:17:21
 */
@Data
@TableName("sale_order")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "销售单")
public class SaleOrder extends BaseModel<SaleOrder> {

    /**
     * 销售单编号
     */
    @ApiModelProperty(value = "销售单号（配送单号）")
    private String saleOrderCode;

    @ApiModelProperty(value = "业务单号:销售单号/销售退货单号/发货单号")
    private String serviceCode;

    @ApiModelProperty(value = "销售单类型（1：销售单；2：销售退货单；4：拒收）")
    private String type;

    @ApiModelProperty(value = "配送单号")
    private String deliveryCode;

    /**
     * 会员编号
     */
    @ApiModelProperty(value = "会员编号")
    private String memberCode;

    /**
     * 买家
     */
    @ApiModelProperty(value = "买家")
    private String name;

    /**
     * 买家电话
     */
    @ApiModelProperty(value = "买家电话")
    private String phone;

    /**
     * 买家所属省市区域
     */
    @ApiModelProperty(value = "买家所属省市区域")
    private String areaName;

    /**
     * 买家收货地址
     */
    @ApiModelProperty(value = "买家收货地址")
    private String address;

    /**
     * 买家备注
     */
    @ApiModelProperty(value = "买家备注")
    private String content;

    @ApiModelProperty(value = "发货仓库编号")
    private String warehouseCode;

    /**
     * 交付/收货时间（客户可设置收货时间）
     */
    @ApiModelProperty(value = "交付/收货时间（客户可设置收货时间）")
    private LocalDateTime deliveryTime;

    /**
     * 支付编号
     */
    @ApiModelProperty(value = "支付编号")
    private String paymentCode;

    /**
     * 预计出库时间
     */
    @ApiModelProperty(value = "预计出库时间")
    private LocalDateTime estimateOutTime;

    @ApiModelProperty(value = "配送员")
    private String deliveryClerk;

    @ApiModelProperty(value = "配送区域")
    private String deliveryArea;

    @ApiModelProperty(value = "经度(后期需要)")
    private BigDecimal longitude;

    @ApiModelProperty(value = "纬度(后期需要)")
    private BigDecimal latitude;

    @ApiModelProperty(value = "订单来源编号")
    private String sourceId;

    @ApiModelProperty(value = "发布方")
    private String publisher;

    /**
     * 状态   0待分拣,1正在分拣(已分配任务给分拣员，处于分拣员分拣中或等待分拣员分拣),2已分拣 3已退货 4分拣缺货 5异常分拣,暂时用数字，类型设置为字符串，后期数字可能会调整
     */
    @ApiModelProperty(value = "状态   0待分拣,1正在分拣(已分配任务给分拣员，处于分拣员分拣中或等待分拣员分拣),2已分拣 3已退货 4分拣缺货 5异常分拣,暂时用数字，类型设置为字符串，后期数字可能会调整")
    private String status;

    @ApiModelProperty(value = "单据来源 0:C端,1:B端")
    private Integer sourceOrigin;

    @ApiModelProperty(value = "销售订单明细")
    @TableField(exist = false)
    public List<SaleOrderDetail> list;

    @ApiModelProperty(value = "是否退货（true:是）")
    @TableField(exist = false)
    private boolean returnOfGoods;

    @ApiModelProperty(value = "是否拒收（true:是）")
    @TableField(exist = false)
    private boolean goodsRejected;

    @ApiModelProperty(value = "预售类型（0:非预售，1：预售)")
    @TableField(exist = false)
    private Integer outStock;
}
